* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: #00A1F1;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(-45deg);
    top: -200px;
    left: -50%;
    z-index: 0;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(-45deg) translate(0, 0);
    }
    to {
        transform: rotate(-45deg) translate(50px, 50px);
    }
}

.login-wrapper {
    width: 500px;
    max-width: 500px;
    height: 500px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-box {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: #00A1F1;
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header Styles */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: #00A1F1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-shadow: 0 10px 30px rgba(0, 161, 241, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 161, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 161, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 161, 241, 0);
    }
}

.logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.library-name {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.3;
    background: #00A1F1;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text {
    font-size: 18px;
    color: #00A1F1;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    color: #64748b;
    font-size: 14px;
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: #fee2e2;
    color: #ef4444;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: #dcfce7;
    color: #10b981;
    border-left: 4px solid #10b981;
}

.alert i {
    font-size: 20px;
}

.alert-message {
    flex: 1;
    font-size: 14px;
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.3s;
    line-height: 1;
}

.alert-close:hover {
    opacity: 1;
}

/* Form Styles */
.login-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    color: #00A1F1;
    font-size: 14px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.input-group.focused {
    transform: translateY(-2px);
}

.input-group .input-icon {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    font-size: 18px;
    transition: all 0.3s;
    z-index: 1;
}

.input-group.focused .input-icon {
    color: #00A1F1;
    transform: scale(1.1);
}

.toggle-password {
    position: absolute;
    right: 15px;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 2;
}

.toggle-password:hover {
    color: #00A1F1;
    transform: scale(1.1);
}

.validation-icon {
    position: absolute;
    right: 45px;
    color: #10b981;
    font-size: 18px;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.form-control {
    width: 100%;
    padding: 15px 45px;
    border: 2px solid #eef2f6;
    border-radius: 14px;
    font-size: 15px;
    transition: all 0.3s;
    background: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: #00A1F1;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 161, 241, 0.1);
}

.form-control.error {
    border-color: #ef4444;
    animation: shake 0.5s ease-in-out;
}

.form-control::placeholder {
    color: #94a3b8;
    font-size: 14px;
    transition: opacity 0.3s;
}

.form-control:focus::placeholder {
    opacity: 0.7;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 28px;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.3s;
}

.checkbox-wrapper:hover input ~ .checkmark {
    background-color: #eef2f6;
    border-color: #00A1F1;
}

.checkbox-wrapper input:checked ~ .checkmark {
    background-color: #00A1F1;
    border-color: #00A1F1;
    animation: bounce 0.3s ease-out;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-wrapper input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-wrapper .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: #475569;
    font-size: 14px;
    transition: color 0.3s;
}

.checkbox-wrapper:hover .checkbox-text {
    color: #00A1F1;
}

/* Forgot Link */
.forgot-link {
    color: #00A1F1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    padding: 5px 10px;
    border-radius: 8px;
}

.forgot-link:hover {
    color: #00A1F1;
    background: rgba(0, 161, 241, 0.1);
    transform: translateX(3px);
}

.forgot-link i {
    font-size: 14px;
    transition: transform 0.3s;
}

.forgot-link:hover i {
    transform: rotate(20deg);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 16px;
    background: #00A1F1;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:hover {
    background: #00A1F1;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 161, 241, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login i {
    font-size: 18px;
    transition: transform 0.3s;
}

.btn-login:hover i {
    transform: translateX(5px);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.divider-text {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Register Section */
.register-section {
    text-align: center;
    margin-top: 20px;
}

.register-text {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 10px;
}

.register-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #00A1F1;
    border: 2px solid #00A1F1;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.register-link:hover {
    background: #00A1F1;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 161, 241, 0.2);
    border-color: transparent;
}

.register-link i {
    font-size: 16px;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover Effects */
.input-group:hover .input-icon:not(.toggle-password) {
    color: #00A1F1;
}

/* Responsive Design */
@media (max-width: 640px) {
    .login-box {
        padding: 30px 20px;
    }

    .library-name {
        font-size: 20px;
    }

    .welcome-text {
        font-size: 16px;
    }

    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .register-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        width: 100%;
    }

    .login-box {
        padding: 25px 15px;
    }

    .logo-container {
        width: 80px;
        height: 80px;
    }

    .logo {
        width: 70px;
        height: 70px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #00A1F1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00A1F1;
}